/*
 * To change this template, choose Tools | Templates
 * and open the template in the editor.
 */
package DTO;

import java.io.Serializable;

import lib.DOMNode;
import ru.qiwi.security.MD5;

/**
 *
 * @author HOME
 */
public class Auth implements Serializable {

    private String sign;
    private String login;
    private String signAlg;

    public Auth(String sign, String login, String signAlg) {
        this.sign = sign;
        this.login = login;
        this.signAlg = signAlg;
    }

    public Auth() {
    }

    public String getLogin() {
        return login;
    }

    public void setLogin(String login) {
        this.login = login;
    }

    public String getSign() {
        return sign;
    }

    public void setSign(String sign) {
        this.sign = sign;
    }

    public String getSignAlg() {
        return signAlg;
    }

    public void setSignAlg(String signAlg) {
        this.signAlg = signAlg;
    }

    //HungLM: chinh theo xml
    public DOMNode toXML() {
        String md5Sign = MD5.hashAsHex(sign);
        DOMNode auth = new DOMNode("auth");
        auth.addAttribute("sign", md5Sign).addAttribute("login", login).addAttribute("signAlg", signAlg);
        return auth;
    }
}
